import scrapy


class Gamer520Spider(scrapy.Spider):

    name = "game520"


    async def start(self):
        urls = [f'https://www.gamer520.com/page/{page}' for page in range(1, 886)]
        for url in urls:
            yield scrapy.Request(url=url)
            break
    async def parse(self, response):
        items = response.xpath("//article[starts-with(@id, 'post-')]")
        for item in items:
            print(item.xpath('.//div[@class="entry-media"]//a/@href')[0])
            print(item.xpath('.//div[@class="entry-media"]//img/@data-src')[0])
            print(item.xpath('.//div[@class="entry-media"]//img/@alt')[0])

